#!/bin/sh

set -e

if [ "$1" = configure ]; then
    # Add the kvm group unless it's already there
    if ! getent group kvm >/dev/null; then
        addgroup --quiet --system kvm || true
    fi
    # Clean up old kvm confiles from jaunty-era kvm
    if [ -n "$2" ] && dpkg --compare-versions "$2" lt 0.12.3-0ubuntu6; then
	for i in "/lib/udev/rules.d/45-kvm.rules" "/etc/init.d/kvm" "/etc/kvm/kvm-ifup"; do
		[ -f "$i" ] && rm -f "$i" || true
	done
    fi
fi

#DEBHELPER#

exit 0

